//  this library.
import 'package:hktk_app/model/practice/practice_question_model.dart';

/// 答案上传时对应的模型
class UploadAnswerModel {
  /// 大题类型
  int? qt;

  /// 试题类型名称 为空时表示标准大题类型
  String? tr;

  /// 题干数据冗余
  List<Stem>? st;

  /// 用户答案
  dynamic as;

  /// 试题签名
  String? sn;

  /// 做题时间
  int? t;

  /// 答案是否正确
  bool? rt;

  /// 是否时新做的题
  bool? newDo;

  /// 答案base64编码
  String? asb;

  UploadAnswerModel({
    this.qt,
    this.tr,
    this.st,
    this.as,
    this.sn,
    this.t,
    this.rt,
    this.newDo,
    this.asb,
  });

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (qt != null) {
      data["qt"] = qt!;
    }
    data["tr"] = tr;
    if (st != null) {
      data["st"] = st!.map((v) => v.toJson()).toList();
    }
    data["as"] = as;
    data["sn"] = sn;
    data["t"] = t;
    data["rt"] = rt;
    data["newDo"] = newDo;
    data["asb"] = asb;
    return data;
  }
}
